﻿@model Resto.CostControl.Core.MaterialPurchase
@{
    ViewBag.Title = "入库单维护";
    Layout = "~/Views/Shared/_LayoutForm.cshtml"; 
}
@using (Html.AjaxBeginForm("Save"))
{ 
    <!-- 主表 --> 
    <div class="pageFormContent" style="width: 600px">
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.OrderState)
        @Html.DWZDropDownListFor(model => model.SupplierId, "Supplier").Required()
        @Html.DWZDateFor(model => model.OrderDate, "yyyy-MM-dd", new { style = "width:180px" })
    </div>
    <div class="clear">
    </div>
    <!-- 子表 --> 
    <div class="pageFormDetailList">
        @Html.Css("flexigrid", "tmpl", "list")
        @Html.Js("flexigrid", "tmpl", "list")
        @(        
 Html.DWZGridFor<Resto.CostControl.Core.MaterialPurchaseItem>()
        .Title("品名列表")
        .ID("MaterialList")
        .Action(@Url.Action("EditList"))
            .ExtParam(new { ParentId = "$('#Id').val()" })
        .Width(580)
        .Height(285)
        .Columns(col =>
        {
            col.Bind(e => e.Id).IsKey().Sortable(false);
            col.Bind(e => e.MaterialId).Hide().Sortable(false);
            col.Bind(e => e.Code).Width(60).Sortable(false);
            col.Bind(e => e.Name).Width(60).Align(FlexiGridAlign.Left).Sortable(false);
            col.Bind(e => e.Category).EnumKey("MaterialCategory").Width(60).Sortable(false);
            col.Bind(e => e.Price).Width(60).Align(FlexiGridAlign.Right).Sortable(false);
            col.Bind(e => e.OrderCount).Width(60).Align(FlexiGridAlign.Right).Sortable(false);
            col.Bind(e => e.DeliveryCount).Template(@Html.TextBox("DeliveryCount", "${OrderCount}", new { style = "text-align:right;width:56px" }).ToString()).Width(60).Sortable(false);
            col.Bind(e => e.StorageCount).Template(@Html.TextBox("StorageCount", "${OrderCount}", new { style = "text-align:right;width:56px" }).ToString()).Width(60).Sortable(false);
        })
        .ShowCheckBox(false)
        .UsePager(false)
    )
    </div>
}
@Html.FormBar()
